package com.tbit.uqbike.client.service;

import com.tbit.uqbike.client.pojo.AdAccountFee;
import com.tbit.uqbike.client.pojo.PayPoints;
import com.tbit.uqbike.client.pojo.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.SortedMap;

/**
 * @Author: chen
 * @Description: 支付分
 * @Date: 创建于 11:20 2020/9/24
 */
public interface PayPointService {

    /**
     * 返回前端挑战授权参数
     *
     * @return
     */
    @Deprecated
    SortedMap<Object, Object> leadData(Integer accountId, Integer userId);

    /**
     * 返回前端挑战授权参数
     *
     * @return
     */
    String pre_authorization(Integer accountId, Integer userId);

    /**
     * 授权服务回调
     *
     * @param httpRequest
     * @return
     */
    void callbackInform(HttpServletRequest httpRequest, HttpServletResponse response);

    /**
     * 创建支付分订单 免确认模式
     *
     * @return
     */
    Boolean wakeUpPaymentPoints(Integer accountId, Integer userId, Integer money, String openid, Integer adAccountId,
                                AdAccountFee adAccountFee);

    /**
     * 创建支付分订单 确认模式
     *
     * @return
     */
    String create_zff_order(Integer accountId, User user);

    /**
     * 获取支付分订单是否成功创建
     *
     * @return
     */
    Boolean getOrderState(String orderNO);
    /**
     * 完结支付分订单
     *
     * @param payPoints
     * @return
     */
    Boolean finishOrder(PayPoints payPoints, Integer accountId, String serNO, AdAccountFee adAccountFee, String name, String time);

    /**
     * 超时结束订单网页使用 弃用
     *
     * @param userId
     * @param money
     * @return
     */
    @Deprecated
    Boolean finishOrderOutTime(Integer userId, Integer money);

    /**
     * 获取用户openid
     *
     * @param code
     * @param appId
     * @param appSecret
     * @return
     */
    public String getOpenid(String code, String appId, String appSecret);

    /**
     * 获取用户支付分服务状态
     *
     * @param user
     * @return
     */
    Boolean get_zff_status(User user);

    /**
     * 取消支付分订单
     *
     * @param user
     * @return
     */
    Boolean cancelOrder(User user, String remark);

    /**
     * 支付分订单退款
     *
     * @param orderNO
     * @param reason
     * @param refundMoney
     * @param user
     */
    Boolean refund(String orderNO, String reason, Integer refundMoney, User user, String refundNo);

    /**
     * 完结支付分订单
     *
     * @param user
     * @return
     */
    Boolean finishOrderOut(User user, Double allMoney, String serNO, Integer adAccountId, String time, Integer diaPatchMoney, String remark);
}
